/*
 * @Description: 标题栏
 * @Author: ziwei.ma
 * @Date: 2019-07-12 16:28:04
 * @Last Modified by: ziwei.ma
 * @Last Modified time: 2019-08-07 18:42:17
 */
<template>
  <title-bar
    id="title-bar"
    :needBorder="false"
    :needBack="false"
    titleText="预约单"
  >
    <i
      slot="left"
      class="icon iconfont icon-back fontsize40 back-btn"
      @click="backPreviousPage"
    ></i>
  </title-bar>
</template>

<script>
import { TitleBar } from 'vue-xb-ui-depot'
export default {
  components: {
    'title-bar': TitleBar
  },
  methods: {
    backPreviousPage() {
      if (this.$route.path === '/step1') {
        window.location.href = 'xbapp://goback'
      } else if (this.$route.path === '/step2') {
        this.$router.push('/step1')
      }
    }
  }
}
</script>

<style scoped>
#title-bar {
  z-index: 99;
  height: 88px;
  color: #ffffff;
}
.back-btn {
  padding: 0 30px;
  position: fixed;
}
</style>
